package com.ruoyi.system.mapper;

import com.ruoyi.system.domain.SysDeviceData;
import com.ruoyi.system.domain.SysRadarData;
import com.ruoyi.system.domain.SysRoom;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * (SysDeviceData)表数据库访问层
 *
 * @author makejava
 * @since 2022-03-16 10:44:34
 */
public interface SysRadarDataMapper {

    /**
     * 新增数据
     *
     * @param sysRadarData 实例对象
     * @return 影响行数
     */
    int insert(SysRadarData sysRadarData);

    /**
     * 修改数据
     *
     * @param sysRadarData 实例对象
     * @return 影响行数
     */
    int update(SysRadarData sysRadarData);

    List<SysRadarData> queryDataByUserId(@Param("userId") Long userId, @Param("deviceCode") String deviceCode, @Param("deviceDataKeyList") List<String> deviceDataKeyList, @Param("startTime") String startTime, @Param("endTime") String endTime);

    List<SysRadarData> queryScaleDataByUserId(@Param("userId") Long userId, @Param("deviceCode") String deviceCode, @Param("deviceDataKeyList") List<String> deviceDataKeyList, @Param("queryTime") String queryTime);

    void deleteByUserId(Long userId);

    String queryOnlineByDeviceCode(@Param("deviceCode") String deviceCode, @Param("deviceDataKey") String deviceDataKey);

    Long queryMaxSomeoneExistsId(@Param("userId") Long userId, @Param("deviceCode") String deviceCode, @Param("deviceDataValue") String deviceDataValue);

    SysRadarData queryById(Long deviceDataId);

    int querySemih(@Param("userId") Long userId, @Param("deviceCode") String deviceCode, @Param("startTime") String startTime, @Param("endTime") String endTime);

    int updateInvalid(@Param("userId") Long userId, @Param("deviceCode") String deviceCode, @Param("startTime") String startTime, @Param("endTime") String endTime);

    List<Map<String,Object>> censusHeartRate();

    List<Map<String,Object>> censusBreath();

    SysRadarData querySomeoneExistsByExist(String deviceCode);

    Integer censusDurationTotal();

    List<Map<String,Object>> censusDuration();

    List<Map<String,Object>> censusSleepScale();

    List<Map<String, Object>> queryCensusYearData(@Param("userId") Long userId, @Param("deviceCode") String deviceCode, @Param("dataKey") String dataKey, @Param("queryTime") String queryTime);

    List<Map<String, Object>> queryCensusMonthData(@Param("userId") Long userId, @Param("deviceCode") String deviceCode, @Param("dataKey") String dataKey, @Param("queryTime") String queryTime);

    List<Map<String, Object>> queryCensusWeekData(@Param("userId") Long userId, @Param("deviceCode") String deviceCode, @Param("dataKey") String dataKey, @Param("startTime") String startTime, @Param("endTime") String endTime);

    List<Map<String, Object>> queryCensusDayData(@Param("userId") Long userId, @Param("deviceCode") String deviceCode, @Param("dataKey") String dataKey, @Param("startTime") String startTime, @Param("endTime") String endTime);
}

